/**
 * Patient session for the client side
 */
package edu.gatech.oad.project.networking.clientSessions; // $codepro.audit.disable packageNamingConvention

import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

import edu.gatech.oad.project.networking.ClientSession;
import edu.gatech.oad.project.operations.data.Appointment;
import edu.gatech.oad.project.operations.data.PatientInformation;
import edu.gatech.oad.project.operations.users.Patient;

/**
 * Patient session for the client side
 * 
 * @author James Moore
 * @version 1.0
 */
public class PatientSessionClient extends ClientSession{

    /**
     * Default constructor 
     * 
     * @param server connection
     * @param outBound stream to the server
     * @param inBound stream from the server
     * @param token security token
     * @param pat the active user
     */
    public PatientSessionClient(Socket server, ObjectOutputStream outBound, 
                                    ObjectInputStream inBound, long token, Patient pat) {
        
        super(server, outBound, inBound, token, pat);
    }
    
    /**
     * Determines if an appointment is available based on time
     * and doctor
     * 
     * @param date the year, month, day
     * @param time the hours, minutes
     * @param docName the doctors name
     * @return true if available, false if otherwise
     */
    public boolean isAvailable(int date, int time, String docName) {
        
        return true;
    }
    
    /**
     * Adds a pending appointment to the database
     * 
     * @param date the year, month, day
     * @param time the hours, minutes
     * @param docName the doctors name
     * @param reason for the appointment
     */
    public void makeAppointment(int date, int time, String docName, String reason) {
        int annoyingRules = 1;
        annoyingRules++;
    }
    
    /**
     * Gets all the appointments for a patient
     * 
     * @return the appointments of a patient
     */
    @Override
    public List<Appointment> getAppointmentByPatient() {
        
        return new ArrayList<Appointment>();
    }
    
    /**
     * deletes an appointment from the patients list
     * 
     * @param app the appointment to delete
     */
    public void deleteAppointment(Appointment app) {
        int annoyingRules = 1;
        annoyingRules++;
    }
    
    /**
     * Gets the patients information based on there name
     * 
     * @param name of the patient
     * @return patient info
     */
    @Override
    public PatientInformation getPatientInfo(String name) {
        return new PatientInformation();
    }
    
    /**
     * Updates the patients info based on their name
     * 
     * @param name of the patient
     * @param info updated information of the patient
     */
    @Override
    public void updatePatientInfo(String name, PatientInformation info){
        int annoyingRules = 1;
        annoyingRules++;
    }

    /**)
     * @see java.lang.Object#toString()
     * @return a string
     */
    @Override
    public String toString() {
        return "PatientSessionClient [server=" + server + ", outBound="
                + outBound + ", inBound=" + inBound + ", token=" + token
                + ", user=" + user + "]";
    }
  
}
